package com.ellricky.excute_president.ui.activity.school

import com.ellricky.baselib.http.callback.ECallback
import com.ellricky.baselib.ui.base.BaseDetailActivity
import com.ellricky.excute_president.API_TY_COURSE_DETAIL
import com.ellricky.excute_president.R
import com.ellricky.excute_president.TyCourseDetailEntity
import kotlinx.android.synthetic.main.pd_activity_ty_detail.*

class TodayTyCourseDetailActivity : BaseDetailActivity() {

    override fun getChildContentLayout(): Int {
        return R.layout.pd_activity_ty_detail
    }

    override fun initUIView() {
        super.initUIView()
        mTvTitle.text = getString(R.string.pd_ty_course_detail)
        loadDetailData(id)
    }


    private fun loadDetailData(id: String) {
        mPresenter.loadDetail(API_TY_COURSE_DETAIL, id, object : ECallback<TyCourseDetailEntity>(this) {
            override fun onSuccess(data: TyCourseDetailEntity?, msg: String) {
                data?.let {
                    tvClassRoom.value = it.classRoomName
                    tvTeacher.value = it.name
                    tvContent.text = it.courseText
                }
            }
        })
    }

}